import React from 'react';
import { Redirect } from 'umi';
export default (props) => {
  const isLogin = localStorage.getItem('pf_token');
  if (isLogin) {
    return <div>{props.children}</div>;
  } else {
    return (
      <Redirect to='/login' />
    );
  }
};